﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace KP_CommonLibrary.KP_Business
{
    public class KP_BLVoucherBase : KP_IBLL
    {
        protected KP_DataAccess.KP_DALVoucher2 DataAccess { get; set; }

        public string MasterTable { get { return DataAccess.MasterTable; } }
        public string DetailTable { get { return DataAccess.DetailTable; } }
        public string RelationName { get { return DataAccess.RelationName; } }
        public KP_BLVoucherBase()
        {
            DataAccess = new KP_CommonLibrary.KP_DataAccess.KP_DALVoucher2();
        }
        public KP_BLVoucherBase(string masterTable, string detailTable)
        {
            DataAccess = new KP_CommonLibrary.KP_DataAccess.KP_DALVoucher2(masterTable, detailTable, true);
        }

        public virtual void Insert(DataRow masterRow, DataRow[] detailRows)
        {
            DataAccess.Insert(null, masterRow, detailRows);
        }
        public virtual void Update(DataRow masterRow, DataRow[] detailRows)
        {
            DataAccess.Update(null,masterRow, detailRows);
        }
        public virtual void Delete(DataRow masterRow, DataRow[] detailRows)
        {
            DataAccess.Delete(null, masterRow, detailRows);
        }
    }
}
